# Contributor: Matthew T Hoare <matthew.t.hoare@gmai.com>
# Maintainer: Matthew T Hoare <matthew.t.hoare@gmai.com>
pkgname=mokutil
pkgver=0.4.0
pkgrel=1
pkgdesc="Utility to manipulate the machine owner keys (MOK) stored in the database of shim"
url="https://github.com/lcp/mokutil"
arch="aarch64 armhf armv7 x86 x86_64" # Secure Boot is only available for these platforms
license="GPL-3.0-or-later"
makedepends="autoconf automake efivar-dev openssl-dev"
options="!check" # no checks
subpackages="$pkgname-doc $pkgname-bash-completion"
source="$pkgname-$pkgver.tar.gz::https://github.com/lcp/mokutil/archive/$pkgver.tar.gz
	fix-int-cast.patch::https://github.com/lcp/mokutil/pull/30.patch"

prepare() {
	default_prepare
	autoreconf -f -i
}

build() {
	./configure \
		--prefix=/usr \
		--sbindir=/sbin \
		--sysconfdir=/etc
	make
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="1caa4242fda51f73b5e1a97ad38d9235cee5e5dad72e3e40c9e44a20c76cd5397e299693733e4d52e3b05b0272a30732d8c3ea86403739cbc6545de16c1a2dd0  mokutil-0.4.0.tar.gz
0c9a5dc4d03969e215564d4fffa365490937239dab350057ccabe5120d794036c92aa2159474a7e99a54c5334dff9b21ef53af6fb873a4c98c8f38eb65c2d8dc  fix-int-cast.patch"
